package com.desay.pangoo.itmt.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import lombok.Data;

/**
 * roadMap_yearQuarter
 * 
 * @author uidq1163
 *
 */
@Entity
@EntityListeners(AuditingEntityListener.class)
@Table(name = "modify_log")
@Data
public class ModifyLogEntity extends BaseEntity implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2059399311866779876L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id", columnDefinition = "bigint COMMENT '主键'")
	private Long id;

	@Column(name = "details", nullable = true, columnDefinition = "mediumtext COMMENT '修改详情'")
	private String details;

	@Column(name = "tech_ptn", nullable = true, columnDefinition = "varchar(255) COMMENT '技术编号'")
	private String techPtn;

	@Column(name = "associated_id", nullable = false, columnDefinition = "int COMMENT '关联ID'")
	private Long associatedId;

	@Column(name = "associated_table", nullable = false, columnDefinition = "varchar(100) COMMENT '修改的数据表'")
	private String associatedTable;

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		ModifyLogEntity other = (ModifyLogEntity) obj;
		if (id == null) {
			if (other.id != null) {
				return false;
			}
		} else if (!id.equals(other.id)) {
			return false;
		}
		return true;
	}
}
